home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / t2win-32 / _windows.frm (.txt) < prev    next >
Visual Basic Form  |  1998-07-13  |  25KB  |  637 lines

  1. VERSION 5.00
  2. Begin VB.Form frmWindows 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Windows 95/NT 4.0x"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   10815
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4845
  13.    ScaleWidth      =   10815
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   -90
  20.       Width           =   10815
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   10440
  26.          TabIndex        =   6
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   9540
  35.          TabIndex        =   5
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   9900
  44.          TabIndex        =   4
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   2
  52.          Top             =   180
  53.          Width           =   8085
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   3
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.TextBox txt_Result 
  65.       BackColor       =   &H00C0C0C0&
  66.       BorderStyle     =   0  'None
  67.       Height          =   4125
  68.       Left            =   120
  69.       Locked          =   -1  'True
  70.       MultiLine       =   -1  'True
  71.       ScrollBars      =   2  'Vertical
  72.       TabIndex        =   0
  73.       Top             =   600
  74.       Width           =   10635
  75.    End
  76. Attribute VB_Name = "frmWindows"
  77. Attribute VB_GlobalNameSpace = False
  78. Attribute VB_Creatable = False
  79. Attribute VB_PredeclaredId = True
  80. Attribute VB_Exposed = False
  81. Option Explicit
  82. Option Base 1
  83. Private Const Iteration = 250
  84. Dim IsLoaded         As Integer
  85. Dim TimerStartOk     As Integer
  86. Dim TimerCloseOk     As Integer
  87. Dim TimerHandle      As Integer
  88. Dim TimerValue       As Long
  89. Private Sub cmdNP_Click(Index As Integer)
  90.    Call sub_NextPrev(cmb_Function, Index)
  91. End Sub
  92. Private Sub cmb_Function_Click()
  93.    If (IsLoaded = False) Then Exit Sub
  94.    Call cDisableFI(mdiT2W.Picture1)
  95.    txt_Result = ""
  96.    DoEvents
  97.    Select Case cmb_Function.ListIndex
  98.       Case 0
  99.          Call TestMultitasksKeys(True)
  100.       Case 1
  101.          Call TestMultitasksKeys(False)
  102.       Case 2
  103.          Call TestLockKeyboard
  104.       Case 3
  105.          Call TestLockMouse
  106.       Case 4
  107.          Call TestModule
  108.       Case 5
  109.          Call TestProcess
  110.       Case 6
  111.          Call TestThread
  112.       Case 7
  113.          Call TestWalkThruWindows
  114.       Case 8
  115.          Call TestTrayBar
  116.       Case 9
  117.          Call TestOSValue
  118.       Case 10
  119.          Call TestIsKeyOn
  120.       Case 11
  121.          Call TestSetKeyState
  122.       Case 12
  123.          Call TestTrashFile
  124.       Case 13
  125.          Call TestGetShortPathName
  126.       Case 14
  127.          Call TestRunFile
  128.    End Select
  129.    DoEvents
  130.    Call cEnableFI(mdiT2W.Picture1)
  131. End Sub
  132. Private Sub Form_Activate()
  133.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  134. End Sub
  135. Private Sub Form_Load()
  136.    IsLoaded = False
  137.    Show
  138.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_windows.t2w")
  139.    IsLoaded = True
  140. End Sub
  141. Private Sub Command1_Click()
  142.    Call cmb_Function_Click
  143. End Sub
  144. Private Sub TestMultitasksKeys(status As Integer)
  145.    Dim intResult        As Integer
  146.    Dim strResult        As String
  147.    Dim strDisplay       As String
  148.    Dim i                As Integer
  149.    strResult = ""
  150.    strDisplay = ""
  151.    If (status = True) Then
  152.       Call cMultitasksKeys(True)
  153.       strDisplay = strDisplay & "MultitasksKeys" & vbCrLf & vbCrLf
  154.       strDisplay = strDisplay & "  are now Disabled" & vbCrLf & vbCrLf
  155.       strDisplay = strDisplay & "     Try CTRL+ALT+DEL or ALT+TAB or CTRL+ESC" & vbCrLf
  156.    Else
  157.       Call cMultitasksKeys(False)
  158.       strDisplay = strDisplay & "MultitasksKeys" & vbCrLf & vbCrLf
  159.       strDisplay = strDisplay & "  are now Enabled" & vbCrLf & vbCrLf
  160.       strDisplay = strDisplay & "     Try CTRL+ALT+DEL or ALT+TAB or CTRL+ESC" & vbCrLf
  161.    End If
  162.    txt_Result = strDisplay
  163.    'time the function
  164.    TimerHandle = cTimerOpen()
  165.    TimerStartOk = cTimerStart(TimerHandle)
  166.    For i = 1 To Iteration
  167.       'Call cMultitasksKeys(Status)
  168.    Next i
  169.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  170.    TimerCloseOk = cTimerClose(TimerHandle)
  171. End Sub
  172. Private Sub TestLockKeyboard()
  173.    Dim intResult        As Integer
  174.    Dim strResult        As String
  175.    Dim strDisplay       As String
  176.    Dim i                As Integer
  177.    strResult = ""
  178.    strDisplay = ""
  179.    intResult = cLockKeyboard(True, &H70)
  180.    If (intResult = True) Then
  181.       strDisplay = strDisplay & "Lock keyboard for 7 seconds (special unlock key = ALT+CTRL+SHIFT+F1)" & vbCrLf & vbCrLf
  182.       For i = 1 To 7
  183.          DoEvents
  184.          txt_Result = strDisplay
  185.          intResult = cSleep(1000)
  186.          strDisplay = strDisplay & "elapsed time : " & i & " second" & IIf(i = 1, "", "s") & vbCrLf
  187.       Next i
  188.       strDisplay = strDisplay & vbCrLf
  189.       strDisplay = strDisplay & "Start unlock keyboard" & vbCrLf
  190.       intResult = cLockKeyboard(False, 0)
  191.       If (intResult = True) Then
  192.          strDisplay = strDisplay & "Keyboard unlocked" & vbCrLf & vbCrLf
  193.       Else
  194.          strDisplay = strDisplay & "Can't unlock keyboard (cross your fingers)" & vbCrLf & vbCrLf
  195.       End If
  196.    Else
  197.       strDisplay = strDisplay & "Can't lock keyboard" & vbCrLf & vbCrLf
  198.    End If
  199.         
  200.    txt_Result = strDisplay
  201.    'time the function
  202.    TimerHandle = cTimerOpen()
  203.    TimerStartOk = cTimerStart(TimerHandle)
  204.    For i = 1 To Iteration
  205.       'Call cLockKeyboard(True,0)
  206.    Next i
  207.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  208.    TimerCloseOk = cTimerClose(TimerHandle)
  209. End Sub
  210. Private Sub TestLockMouse()
  211.    Dim intResult        As Integer
  212.    Dim strResult        As String
  213.    Dim strDisplay       As String
  214.    Dim i                As Integer
  215.    strResult = ""
  216.    strDisplay = ""
  217.    intResult = cLockMouse(True, LOCK_MOUSE_ALL_CLICK)
  218.    If (intResult = True) Then
  219.       strDisplay = strDisplay & "Lock mouse (ALL CLICK) for 4 seconds" & vbCrLf & vbCrLf
  220.       For i = 1 To 4
  221.          DoEvents
  222.          txt_Result = strDisplay
  223.          intResult = cSleep(1000)
  224.          strDisplay = strDisplay & "elapsed time : " & i & " second" & IIf(i = 1, "", "s") & vbCrLf
  225.       Next i
  226.       strDisplay = strDisplay & vbCrLf
  227.       strDisplay = strDisplay & "Start unlock mouse" & vbCrLf
  228.       intResult = cLockMouse(False, 0)
  229.       If (intResult = True) Then
  230.          strDisplay = strDisplay & "Mouse unlocked" & vbCrLf & vbCrLf
  231.       Else
  232.          strDisplay = strDisplay & "Can't unlock mouse (cross your fingers)" & vbCrLf & vbCrLf
  233.       End If
  234.    Else
  235.       strDisplay = strDisplay & "Can't lock mouse" & vbCrLf & vbCrLf
  236.    End If
  237.         
  238.    intResult = cLockMouse(True, LOCK_MOUSE_RCLICK)
  239.    If (intResult = True) Then
  240.       strDisplay = strDisplay & "Lock mouse (RIGHT CLICK) for 4 seconds" & vbCrLf & vbCrLf
  241.       For i = 1 To 4
  242.          DoEvents
  243.          txt_Result = strDisplay
  244.          intResult = cSleep(1000)
  245.          strDisplay = strDisplay & "elapsed time : " & i & " second" & IIf(i = 1, "", "s") & vbCrLf
  246.       Next i
  247.       strDisplay = strDisplay & vbCrLf
  248.       strDisplay = strDisplay & "Start unlock mouse" & vbCrLf
  249.       intResult = cLockMouse(False, 0)
  250.       If (intResult = True) Then
  251.          strDisplay = strDisplay & "Mouse unlocked" & vbCrLf & vbCrLf
  252.       Else
  253.          strDisplay = strDisplay & "Can't unlock mouse (cros